package net.worldscale.xp.wslib.urm;

public abstract class URI {

    /**
     * scheme without ':'
     * */
    public abstract String getScheme();

    /**
     * host without '//'
     * */
    public abstract String getHost();

    /**
     * port without ':'
     * */
    public abstract String getPort();

    public abstract String getPath();

    /**
     * query without '?'
     * */
    public abstract String getQuery();

    /**
     * fragment without '#'
     * */
    public abstract String getFragment();

    public static URI newInstance(String scheme, String host, String port,
            String path, String query, String frag) throws BadUriException {
        return URM.getInstance().newURI(scheme, host, port, path, query, frag);

    }

    public static URI newInstance(String uri) throws BadUriException {
        return URM.getInstance().newURI(uri);
    }

    public static URI calc(String base, String offset) throws BadUriException {
        return URM.getInstance().calcURI(base, offset);
    }

    public static URI calc(URI base, URI offset) throws BadUriException {
        return URM.getInstance().calcURI(base, offset);
    }
}
